package com.sskj.gocoin.mine;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.gocoin.m.HttpConfig;
import com.sskj.gocoin.m.bean.HttpData;
import com.sskj.gocoin.m.bean.ShareEntry;
import com.sskj.gocoin.m.http.JsonCallBack;
import com.sskj.gocoin.p.base.BasePresenter;


/**
 * @author Hey
 * Create at  2019/04/01
 */
class MySharePresenter extends BasePresenter<MyShareActivity> {

    public void getData(int page) {
        OkGo.<HttpData<ShareEntry>>get(HttpConfig.BASE_URL + HttpConfig.SHARE_DETAIL)
                .params("p", page)
                .execute(new JsonCallBack<HttpData<ShareEntry>>(this,true) {
                    @Override
                    protected void _onSuccess(Response<HttpData<ShareEntry>> response) {
                        mView.setData(response.body().getData());
                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                    }
                });
    }
}
